if (!TrvnData) {
	var TrvnData = {};

	var _TrvnURL = function(gid, title) {
		this.gid = gid;
		this.title = title;
	}
	_TrvnURL.prototype.toURL = function(newdid) {
		return 'build.php?gid=' + this.gid + (newdid ? ('&newdid=' + newdid) : '');
	}
	_TrvnURL.prototype.toLink = function(newdid, target) {
		return '<a href="' + this.toURL(newdid) + '"' + (target ? ' target="' + target + '"' : '') + '>' + this.title
				+ '</a>';
	}
	_TrvnURL.prototype.toDomA = function(doc, newdid, target) {
		if (!doc) return this.toLink(newdid);
		var a = doc.$C("a");
		a.href = this.toURL(newdid);
		a.innerHTML = this.title;
		if (target) {
			a.target = target;
		}
		return a;
	}
	TrvnData.url = {
		blacksmith : new _TrvnURL(12, "铁匠铺"),
		armoury : new _TrvnURL(13, "军械库"),
		tournamentSquare : new _TrvnURL(14, "竞技场"),
		mainBuilding : new _TrvnURL(15, "中心大楼"),
		rallyPoint : new _TrvnURL(16, "集结点"),
		marketplace : new _TrvnURL(17, "市场"),
		embassy : new _TrvnURL(18, "大使馆"),
		barracks : new _TrvnURL(19, "兵营"),
		stable : new _TrvnURL(20, "马厩"),
		workshop : new _TrvnURL(21, "工场"),
		academy : new _TrvnURL(22, "研发所"),
		townHall : new _TrvnURL(24, "市政厅"),
		residence : new _TrvnURL(25, "行宫"),
		palace : new _TrvnURL(26, "皇宫"),
		treasury : new _TrvnURL(27, "宝库"),
		tradeOffice : new _TrvnURL(28, "交易所"),
		greatBarracks : new _TrvnURL(29, "大兵营"),
		greatStable : new _TrvnURL(30, "大马厩"),
		stonemason : new _TrvnURL(34, "石匠铺"),
		herosMansion : new _TrvnURL(37, "英雄园"),
		chromHome : 'chrome://traviants/content'
	};

	TrvnData.xPath = {
		villageTable : '//div[@id="lright1"]//table[@class="f10"]',
		villageMenuA : '//div[@id="lmidall"]//td[@class="menu"]//a',
		marketBuyTable : '//table[@class="tbg"]',
		messageCheckboxes : '//form[@name="msg"]//input[@type="checkbox"]',
		messageDeleteButton : '//form[@name="msg"]//input[@type="submit"]',
		buildTaskTable1 : '//div[@id="lbau1"]//table',
		buildTaskTable2 : '//div[@id="lbau2"]//table',
		mapImageDiv : '//div[@class="mdiv"]',
		mapMap : '//div[@id="map_content"]//map',
		villageType : '//div[@id="f1"] | //div[@id="f2"] | //div[@id="f3"] | //div[@id="f4"] | //div[@id="f5"] | //div[@id="f6"]'
	};

	var _TrvnVlgType = function(id, sName, sHtml) {
		this.id = id;
		this.textName = sName;
		this.html = sHtml;
	}
	_TrvnVlgType.prototype.toString = function() {
		return this.textName;
	}
	TrvnData.villageType = {
		normal : new _TrvnVlgType('f3', 'normal', 'N'),
		lumber : new _TrvnVlgType('f5', 'lumber', '<img class="res" src="img/un/r/1.gif" />'),
		clay : new _TrvnVlgType('f4', 'clay', '<img class="res" src="img/un/r/2.gif" />'),
		iron : new _TrvnVlgType('f2', 'iron', '<img class="res" src="img/un/r/3.gif" />'),
		crop9 : new _TrvnVlgType('f1', 'crop9', '<img class="res" src="img/un/r/4.gif" />'),
		crop15 : new _TrvnVlgType('f6', 'crop15', '<img class="res" src="img/un/r/4.gif" /><img class="res" src="img/un/r/4.gif" />'),
		getType : function(id) {
			if (id == 'f3') return this.normal;
			if (id == 'f5') return this.lumber;
			if (id == 'f4') return this.clay;
			if (id == 'f2') return this.iron;
			if (id == 'f1') return this.crop9;
			if (id == 'f6') return this.crop15;
			return 'undefined';
		}
	};
}